<!DOCTYPE html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <title>类型转换</title>
 </head>
 <body>
  <script>
    var a='123';
    var b = a+6;
    document.write('没用Number转换前:'+b);
    document.write('<br/>');
    var c = Number(a)+6;
    document.write('用Number转换后:'+c);
    document.write('<hr/>');    //画一行横线
    var x = 33;
    var y = x+66;
    document.write('没用String转换前:'+y);
document.write('<br/>');
    var m = String(x)+66;
    document.write('用String转换后:'+m);
    document.write('<hr/>');
    var t = 13;
    var f = 0;
    var b1 = Boolean(t);
    var b2 = Boolean(f);
    document.write('用Boolean转换后:t='+b1+',f='+b2);
  </script>
 </body>
</html>
